function trimStart(str: string, replacedStr?: string) {
    if (replacedStr?.trim()?.length > 0) {
        if (str?.startsWith(replacedStr)) {
            return str.slice(replacedStr.length);
        }
    } else {
        return str?.trim();
    }

    return str;
}

function splitCase(str: string, splitChar: string = '_'): string {
    return str?.toString()?.replace(new RegExp('([a-z|0-9])([A-Z])', 'g'), (contentMatch, $1) => {
        return contentMatch.replace($1, `${$1}${splitChar}`);
    });
}

function isEmpty(str: string): boolean {
    return (str?.toString()?.trim()?.length ?? -1) <= 0;
}

export { trimStart, splitCase, isEmpty };
